gtk_widget_set_has_window (GTK_WIDGET (menu_item), FALSE);
- priv->submenu = NULL;
- priv->toggle_size = 0;
- priv->accelerator_width = 0;
- priv->show_submenu_indicator = FALSE;
+ priv->action = NULL;
+ priv->use_action_appearance = TRUE;
+
+ menu_item->submenu = NULL;
+ menu_item->toggle_size = 0;
+ menu_item->accelerator_width = 0;
if (gtk_widget_get_direction (GTK_WIDGET (menu_item)) == GTK_TEXT_DIR_RTL)
priv->submenu_direction = GTK_DIRECTION_LEFT;
else
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
- if (priv->submenu && priv->show_submenu_indicator)
- {
- guint arrow_spacing;
- gint arrow_size;
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
+ {
+ guint arrow_spacing;
+ gint arrow_size;
+
+ gtk_widget_style_get (widget,
+ "arrow-spacing", &arrow_spacing,
+ NULL);
+
+ get_arrow_size (widget, child, &arrow_size);
gtk_widget_style_get (widget,
"arrow-spacing", &arrow_spacing,
min_height += child_min;
nat_height += child_nat;
- if (priv->submenu && priv->show_submenu_indicator)
- {
- gint arrow_size;
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
+ {
+ gint arrow_size;
get_arrow_size (widget, child, &arrow_size);
{
gint child_min, child_nat;
gint arrow_size = 0;
-
- if (priv->submenu && priv->show_submenu_indicator)
- {
+
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
+ {
guint arrow_spacing;
gtk_widget_style_get (widget,
min_height += child_min;
nat_height += child_nat;
- if (priv->submenu && priv->show_submenu_indicator)
- {
- min_height = MAX (min_height, arrow_size);
- nat_height = MAX (nat_height, arrow_size);
- }
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
+ {
+ min_height = MAX (min_height, arrow_size);
+ nat_height = MAX (nat_height, arrow_size);
+ }
}
else /* separator item */
{
child_allocation.y += allocation->y;
gtk_widget_get_preferred_size (child, &child_requisition, NULL);
- if (priv->submenu && priv->show_submenu_indicator)
- {
- if (direction == GTK_TEXT_DIR_RTL)
- child_allocation.x += child_requisition.height;
- child_allocation.width -= child_requisition.height;
- }
-
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
+ {
+ if (direction == GTK_TEXT_DIR_RTL)
+ child_allocation.x += child_requisition.height;
+ child_allocation.width -= child_requisition.height;
+ }
+
if (child_allocation.width < 1)
child_allocation.width = 1;
GtkStateType state_type;
GtkShadowType shadow_type, selected_shadow_type;
GtkStyle *style;
- GtkWidget *child;
+ GtkWidget *child, *parent;
GdkWindow *window;
gint x, y, w, h, width, height;
guint border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
h = height - border_width * 2;
child = gtk_bin_get_child (GTK_BIN (menu_item));
-
+ parent = gtk_widget_get_parent (widget);
+
if (child && state_type == GTK_STATE_PRELIGHT)
{
gtk_widget_style_get (widget,
x, y, w, h);
}
- if (priv->submenu && priv->show_submenu_indicator)
+ if (menu_item->submenu && !GTK_IS_MENU_BAR (parent))
{
gint arrow_x, arrow_y;
gint arrow_size;